import babel from '@rollup/plugin-babel'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import serve from 'rollup-plugin-serve'
import livereload from 'rollup-plugin-livereload'
import css from "rollup-plugin-import-css";

export default {
    // 主文件
    input: "./src/index.js",
    output: [
        {
            file: './dist/gis-map.js',
            name: 'GISMap',
            format: 'umd',
            sourcemap: true
        }
    ],
    plugins: [
        serve({
            contentBase: 'dist', // 服务器启动的文件夹，默认是项目根目录
            port: 18080 // 端口号
        }),
        livereload('dist'), // 监听dist目录
        babel({
            exclude: 'node_modules/**'
        }),
        resolve(),
        commonjs(),
        css()
    ]
}
